<template>
  <ElTag v-if="column.type == 'yesno'" :type="value == 'yes' ? 'success' : 'info'" >{{ value == 'yes' ? '是' : '否' }}</ElTag>
  <div v-else>{{ value }}</div>
</template>
<script setup lang="ts">
  import { ElTag } from 'element-plus'
  import { Column } from '@/seed-application/types';
  import { toCamelCase } from '@/utils/func';
  import { computed } from 'vue';
  import { getColumnValue } from '@/seed-application/utils/ColumnUtil';

  const props = defineProps<{column: Column, row: Record<string, any>}>()
  const column = props.column
  const row = props.row
  const value = computed(() => getColumnValue(row, toCamelCase(column.name)))
</script>
